package com.smart.milvus.conditions;

import com.smart.milvus.base.func.SFunction;

import java.io.Serializable;
import java.util.Collection;

public interface ChildrenWrapper<Children, R> extends Serializable {

    <M> Children eq(boolean condition, SFunction<R, M> column1, SFunction<M, ?> column2, Object val);

    <M> Children ne(boolean condition, SFunction<R, M> column1, SFunction<M, ?> column2, Object val);

    <M> Children gt(boolean condition, SFunction<R, M> column1, SFunction<M, ?> column2, Object val);

    <M> Children ge(boolean condition, SFunction<R, M> column1, SFunction<M, ?> column2, Object val);

    <M> Children lt(boolean condition, SFunction<R, M> column1, SFunction<M, ?> column2, Object val);

    <M> Children le(boolean condition, SFunction<R, M> column1, SFunction<M, ?> column2, Object val);

    <M> Children notLikeRight(boolean condition, SFunction<R, M> column1, SFunction<M, ?> column2, Object val);

    <M> Children likeRight(boolean condition, SFunction<R, M> column1, SFunction<M, ?> column2, Object val);

    <M> Children in(boolean condition, SFunction<R, M> column1, SFunction<M, ?> column2, Collection coll);

    <M> Children notIn(boolean condition, SFunction<R, M> column1, SFunction<M, ?> column2, Collection coll);

    <M> Children jsonContains(boolean condition, SFunction<R, M> column1, SFunction<M, ?> column2, Object value);

    <M> Children jsonContainsAll(boolean condition, SFunction<R, M> column1, SFunction<M, ?> column2, Collection coll);

    <M> Children jsonContainsAny(boolean condition, SFunction<R, M> column1, SFunction<M, ?> column2, Collection coll);


    default <M> Children eq(SFunction<R, M> column1, SFunction<M, ?> column2, Object val) {
        return eq(true, column1, column2, val);
    }

    default <M> Children ne(SFunction<R, M> column1, SFunction<M, ?> column2, Object val) {
        return ne(true, column1, column2, val);
    }

    default <M> Children gt(SFunction<R, M> column1, SFunction<M, ?> column2, Object val) {
        return gt(true, column1, column2, val);
    }

    default <M> Children ge(SFunction<R, M> column1, SFunction<M, ?> column2, Object val) {
        return ge(true, column1, column2, val);
    }

    default <M> Children lt(SFunction<R, M> column1, SFunction<M, ?> column2, Object val) {
        return lt(true, column1, column2, val);
    }

    default <M> Children le(SFunction<R, M> column1, SFunction<M, ?> column2, Object val) {
        return le(true, column1, column2, val);
    }

    default <M> Children notLikeRight(SFunction<R, M> column1, SFunction<M, ?> column2, Object val) {
        return notLikeRight(true, column1, column2, val);
    }

    default <M> Children likeRight(SFunction<R, M> column1, SFunction<M, ?> column2, Object val) {
        return likeRight(true, column1, column2, val);
    }

    default <M> Children in(SFunction<R, M> column1, SFunction<M, ?> column2, Collection coll) {
        return in(true, column1, column2, coll);
    }

    default <M> Children notIn(SFunction<R, M> column1, SFunction<M, ?> column2, Collection coll) {
        return notIn(true, column1, column2, coll);
    }

    default <M> Children jsonContains(SFunction<R, M> column1, SFunction<M, ?> column2, Object value) {
        return jsonContains(true, column1, column2, value);
    }

    default <M> Children jsonContainsAll(SFunction<R, M> column1, SFunction<M, ?> column2, Collection coll) {
        return jsonContainsAll(true, column1, column2, coll);
    }

    default <M> Children jsonContainsAny(SFunction<R, M> column1, SFunction<M, ?> column2, Collection coll) {
        return jsonContainsAny(true, column1, column2, coll);
    }
}
